<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>2965：保护古迹</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">保护古迹</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">保护古迹</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                保护古迹                </h1>
                <p>时间限制：20s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：256MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><p><span style="font-size: medium">　　某校由于历史悠久，校园中有大量的名胜古迹。为了更好地保护这些古迹，学校决定用篱笆将这些古迹围起来。<br />
　　现在已知有p个地点的古迹需要保护。这些古迹可以看做二维平面上的整数点。有n个点可以作为篱笆的端点，这些端点的坐标也为二维平面上的整数。端点用1到n的整数编号。<br />
　　有m对端点之间可以修建篱笆。用(u,v,w)描述一段可以修建的篱笆，表示端点u和端点v之间可以花费w的代价修建一段。篱笆都看做直线段。为了方便设计，这些可以修建的篱笆都是不会相交的（只会在端点处相交）。<br />
　　将一个古迹围起来是指存在一个由篱笆构成的简单多边形，这个古迹在该多边形内部。<br />
　　由于经费问题，学校希望修建篱笆的花费最小。你需要输出将至少1个，2个，&hellip;，p个古迹围起来的最小花费。<br />
</span></p></p><hr/><h3>输入格式</h3><p><p><font size="4">　　第一行包含三个正整数p,n,m表示古迹的个数，端点个数和可以修建的篱笆条数。<br />
　　接下来p行，每行包含两个整数，表示每个古迹的坐标。<br />
　　接下来n行，每行包含两个整数，表示每个端点的坐标。这些端点按照输入的顺序依次用1到n的整数编号。<br />
　　最后m行，每行包含三个非负整数u,v,w，表示可以在端点u和端点v之间花w的代价修建一段篱笆。<br />
</font></p></p><hr/><h3>输出格式</h3><p><p><font size="4">　　输出p行，分别表示将至少1个，2个，&hellip;，p个古迹围起来的最小花费。<br />
</font></p></p><hr/><h3>样例输入</h3><pre>3 9 15
-2 2
2 1
2 -1
3 0
3 2
1 2
-1 3
-3 3
-2 1
1 0
2 -2
2 -3
1 2 20
1 7 40
1 8 10
1 9 100
2 3 50
3 4 1000
3 7 10
4 5 10
4 6 10
4 7 1000
5 6 10
6 7 1000
7 8 120
7 9 10
8 9 10
</pre><hr/><h3>样例输出</h3><pre>30
100
140</pre><hr/><h3>提示</h3><p><p><img height="1145" width="332" alt="" src="../file/2965_0.jpg" /></p>
<p><span style="display: inline! important; float: none; word-spacing: 0px; font: 14px 'Times New Roman', ����; text-transform: none; color: rgb(32,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; background-color: rgb(255,255,255); text-align: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">　对于100%的数据，n&le;100， m&le;C(n,2)，p&le;10。所有坐标位置的两维绝对值不超过10</span><sup style="font-weight: normal; word-spacing: 0px; text-transform: none; color: rgb(32,0,0); text-indent: 0px; line-height: normal; font-style: normal; font-family: 'Times New Roman', ����; white-space: normal; letter-spacing: normal; background-color: rgb(255,255,255); text-align: left; font-variant: normal; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">9</sup><span style="display: inline! important; float: none; word-spacing: 0px; font: 14px 'Times New Roman', ����; text-transform: none; color: rgb(32,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; background-color: rgb(255,255,255); text-align: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">，u,v不超过n，w不超过10</span><sup style="font-weight: normal; word-spacing: 0px; text-transform: none; color: rgb(32,0,0); text-indent: 0px; line-height: normal; font-style: normal; font-family: 'Times New Roman', ����; white-space: normal; letter-spacing: normal; background-color: rgb(255,255,255); text-align: left; font-variant: normal; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">6</sup><span style="display: inline! important; float: none; word-spacing: 0px; font: 14px 'Times New Roman', ����; text-transform: none; color: rgb(32,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; background-color: rgb(255,255,255); text-align: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">。</span><br style="word-spacing: 0px; font: 14px 'Times New Roman', ����; text-transform: none; color: rgb(32,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; background-color: rgb(255,255,255); text-align: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px" />
<span style="display: inline! important; float: none; word-spacing: 0px; font: 14px 'Times New Roman', ����; text-transform: none; color: rgb(32,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; background-color: rgb(255,255,255); text-align: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">　　保证可以修建的篱笆不会经过古迹。保证可以修建的两段篱笆不会在非端点处相交或重合。保证至少存在一种方案可以包围所有古迹。保证n个点互不相同。</span></p></p><hr/><h3>题目来源</h3><p>中国国家队清华集训 2012-2013 第四天
</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=2965" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=2965" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>